package com.aurora.supermarket.home.javascrip;

import android.content.Context;
import android.content.Intent;

import com.aurora.supermarket.widget.photoview.DragPhotoActivity;

import java.util.ArrayList;

// js通信接口
 public class JavascriptInterface {

        private Context context;


        public JavascriptInterface(Context context) {
            this.context = context;
        }

        @android.webkit.JavascriptInterface        
        public void openImage(String img) {
            ArrayList<String> pics = new ArrayList<>();
            pics.add(img);
            pics.add(img);
            Intent intent = new Intent();
            intent.setClass(context, DragPhotoActivity.class);
            intent.putStringArrayListExtra("list", pics);
            context.startActivity(intent);
            System.out.println(img);
        }
    }